<form class="form-inline" method="get">

    <div class="form-group col-xs-1">
        <div class="col-xs-12">
            <input class="form-control" type="text" name="uid" value="{$uid}"
                   placeholder="编号">
        </div>
    </div>
    <div class="form-group col-xs-1">
        <div class="col-xs-12">
            <input class="form-control" type="text" name="username" value="{$username}"
                   placeholder="用户名">
        </div>
    </div>
    <div class="form-group col-xs-2">
        <div class="col-xs-12">
            <input class="form-control" type="number" name="selfphone" value="{$selfphone}"
                   placeholder="手机号">
        </div>
    </div>
    <div class="form-group col-xs-2">
        <div class="col-xs-12">
            <input class="form-control" name="realname" value="{$realname}"
                   placeholder="真实姓名">
        </div>
    </div>
    <div class="form-group col-xs-1">
        <div class="col-xs-12">
            <select class="form-control" name="is_active" id="is_active">
                <option value=''   {if $is_active eq ''}selected{/if} >全部</option>
                <option value='-1'  {if $is_active eq '2'}selected{/if}>不能登录</option>
                <option value='1' {if $is_active eq '1'}selected{/if}>可以登陆</option>
            </select>
        </div>
    </div>
    <div class="form-group col-xs-1">
        <div class="col-xs-12">
            <select class="form-control" name="apply_open" id="apply_open">
                <option value=''   {if $apply_open eq ''}selected{/if} >全部</option>
                <option value='2'  {if $apply_open eq '2'}selected{/if}>官方号</option>
                <option value='1' {if $apply_open eq '1'}selected{/if}>普通</option>
            </select>
        </div>
    </div>

    <div class="form-group col-xs-1">
        <div class="col-xs-12">
            <select class="form-control" name="levelid" id="levelid">
                <option value=''   {if $levelid eq ''}selected{/if} >全部</option>
                {volist name='catelist' id='cv'}
                    <option value='{$cv.id}' {if $levelid eq $cv.id}selected{/if} >{$cv.title}</option>
                {/volist}
            </select>
        </div>
    </div>
    <div class="form-group col-xs-1">
        <div class="col-xs-12">
            <select class="form-control" name="is_levfix" id="is_levfix">
                <option value=''   {if $is_levfix eq ''}selected{/if} >全部</option>
                <option value='2' {if $is_levfix eq '2'}selected{/if} >固定</option>
                <option value='1' {if $is_levfix eq '1'}selected{/if} >不固定</option>
            </select>
        </div>
    </div>

    <div class="form-group col-xs-2">
        <div class="col-xs-12">
            <button type="submit" class="btn btn-success">
                确认搜索
            </button>
        </div>
    </div>
</form>
<div class="form-group col-xs-2">
    <div class="col-xs-12">
        <button type="button" onclick="modal('{:url(\'add\')}', '添加会员')" class="btn btn-success">
            添加会员
        </button>
    </div>
</div>
<hr>
<table class="table table-striped">
    <thead>
    <tr>
        <td>ID</td>
        <td>用户名</td>
        <td>买卖订单数量</td>
        <td>手机</td>
        <td>真实姓名</td>
        <td>推荐人</td>
        <td>转账激活和登录</td>
        <td>是否官方号</td>
		<td>现有</td>
        <td>操作</td>
    </tr>
    </thead>
    <tbody>
    {volist name="list.data" id="item"}
    <tr>
        <td>{$item.id}</td>
        <td>
            <p>{$item.username}[{$item.catetitle}]</p>
            {if $item['hello'] eq 2}<p class='label label-success'>不可描述</p>{/if}
			<p>紧急:{$item.mustman}</p>
		</td>
        <td>
            <p>买:{$item.buynums} 卖{$item.salenums}</p>
            <!--<p>-->
                <!--{if condition="$item['salenums'] neq $item['buynums']"}-->
                    <!--<label style='color:red'>此人订单异常</label>-->
                <!--{/if}-->
            <!--</p>-->
       
            <p>累计收入:{$item.id|getProfits}</p>
        </td>
        <td>{$item.selfphone}</td>
        <td>{$item.realname}</td>
        <td>{$item.pid|get_uname}</td>
        <td>
            <p>{if condition="$item['user_status'] == 1" } <label style='color:#ff9797'>已转账激活</label>{/if}
            {if condition="$item['user_status'] != 1" }<label style='color:#666'>未转账激活</label>{/if}</p>
			<p>
				{if condition="$item['is_active'] == 1" }
					<label class="label btn-success">可登录</label>
				{else/}
					<label class="label label-default">不可登录</label>
				{/if}
			</p>
		</td>
		<td>
				{if condition="$item['is_our'] == 2" }
					<p>官方号[可任意购买]</p>
				{else/}
					<p style='color:#999;'>非官方号</p>
				{/if}
        </td>
		<td>
			<p>SCB:{$item.mybot}</p>
			<p>共享豆:{$item.integral}</p>
		</td>
        <td>
            <div class="btn-group">
                <button type="button" class="btn btn-default dropdown-toggle"  data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                    操作
                    <span class="caret"></span>
                </button>
                <ul class="dropdown-menu">
                    <li>
                        <a href="javascript:void(0)" onclick="modal('{:url(\'edit\',array(\'id\'=>$item[\'id\']))}', '编辑会员')">
                            编辑
                        </a>
                    </li>
                    <li>
                        <a href="javascript:void(0)" data-toggle="confirm"
                           data-title="重置密码"
                           data-content="确认要重置密码为: 123456？请谨慎操作"
                           data-url="{:url('usermb',array('id'=>$item['id']))}">
                            重置密码
                        </a>
                    </li>
                    <li>
                        <a href="javascript:void(0)" data-toggle="confirm"
                           data-title="删除会员"
                           data-content="确认要删除该会员吗？删除后无法找回,请谨慎操作"
                           data-url="{:url('delete',array('id'=>$item['id']))}">
                            删除
                        </a>
                    </li>
                    <li>
                        <a href="{:url('loginadmin',array('id'=>$item['id']))}" target="_blank">
                            登入
                        </a>
                    </li>
                    <li role="separator" class="divider"></li>
                </ul>
            </div>
        </td>
    </tr>
    {/volist}
    </tbody>
</table>

<div class="row">
    <div class="col-xs-12" style="text-align: right;">
        {$page}
    </div>
</div>
<script src="__PUBLIC__/vendors/select2/js/select2.min.js"></script>
<script type="application/javascript">
    $(function () {
        $("#is_active").select2({
            placeholder: "登录状态",
            allowClear: true
        });
    });
    $(function () {
        $("#apply_open").select2({
            placeholder: "是否官方号",
            allowClear: true
        });
    });
    $(function () {
        $("#levelid").select2({
            placeholder: "当前等级",
            allowClear: true
        });
    });
    $(function () {
        $("#is_levfix").select2({
            placeholder: "是否固定等级",
            allowClear: true
        });
    });
</script>
